<template>
	<view>
		<!-- <view style="height: 40px;background-color: red;">
			
		</view> -->
		<view class="uni-list">
			<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(item,index) in list" :key="index" @click="addCity(item)">
				<view class="uni-media-list">
					<view class="uni-media-list-body">
						<view class="uni-media-list-text-top">{{item.community_name}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {getList} from "@/api/community.js";
	export default {
		data() {
			return {
				params:{},
				list:[],
				id:''
			}
		},
		onLoad(){
			this.getComunityList();
			// this.getCity();
		},
		methods: {
			getComunityList(){
				getList({keyword:"123"}).then((res)=>{
					if(res.data.code==0){
						this.list=res.data.data.list;
					}
					
				})
			},
			getCity(){
				const data ={
					type:5,
					id:'',
					login_token:this.$store.state.login_token
				}
			},
			addCity(item){
				this.$store.commit('setCommunity',item);
				uni.navigateBack({
					delta:1
				})
			}
		}
		
	}
</script>

<style>
.uni-media-list-body{
	height: 45upx;
}
</style>
